<template>
  <div style="color: #FFFFFF;text-align: center;line-height: 30px;margin-top:200px;font-size: 30px">{{initMessage}}</div>
</template>
<script>
  export default {
    extends: extend,
    name: "Jmp",

    data: function () {
      return {
        initMessage:'正在初始化终端信息...',
        msg: "Welcome"
      }
    },
    methods: {
      //获取终端信息回调
      getClientInfoCallback: function (obj) {
        try {
          if (obj.status == 0) {
            this.$parent.clientInfo=obj.data;
            this.$parent.startRunTime=obj.data.TotalRunTime;
            P_Client.supervision_start_thread(JSON.stringify(this.$parent.clientInfo));
            P_Client.startCamera();
            this.go("/standby");
          } else if(obj.status == 2) {
            this.initMessage='终端初始化失败：'+ obj.message;
          }
          else{
            this.$toast.error({
              message:obj.message,
              time: 2000,// 显示的时长
            });
              // 如果中断未注册， 则跳转到注册终端页面
          if(obj.message=='该终端ID未注册！'){
            console.log('123333333333')
            this.go('/registerCabinet')
          }
          }
        } catch (e) {
          this.initMessage='终端初始化失败：'+ e.message;
        }
      }
    },
    mounted: function () {
      //获取终端信息
      setTimeout(function (){
        P_Client.getClientInfo();       
      }, 1000);
    }
  };
</script>
